package com.tuanbiao.ui.auth.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hzjq.data.hzjq.entity.CapRecordEntity;
import com.tuanbiao.R;

import timber.log.Timber;

/**
 * @author abiao
 * @since 2022/4/22 16:40
 */
public class AuthOnlineAdapter extends BaseQuickAdapter<CapRecordEntity, BaseViewHolder> {
    public AuthOnlineAdapter() {
        super(R.layout.item_auth_online);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, CapRecordEntity entity) {
        Timber.i("" + entity);
        holder.setText(R.id.tv_detonator_code, entity.getConvertUid())
                .setText(R.id.tv_delay, entity.getDelay() + "ms")
                .setTextColorRes(R.id.tv_status, entity.isAuth() ? R.color.textSuccess : R.color.textDanger)
                .setText(R.id.tv_status, entity.isAuth() ? "已授权" : "未授权");
    }
}
